#ifndef UHM_MAT_EXTENSION_LU_INCPIV_HXX_
#define UHM_MAT_EXTENSION_LU_INCPIV_HXX_

namespace uhm {
  
  // Basic LU incpiv...
  template<class A_, class B_>
  class LU_incpiv_ : public LU_piv_<A_,B_> {
  private:
  protected:
  public:

    LU_incpiv_() : LU_piv_<A_,B_>() { }
    LU_incpiv_(Int_ type, Int_ uplo, Int_ sym,
               Int_ mt, Int_ mb,
               Int_ rhs, Int_ blk) 
      : LU_piv_<A_,B_>(type, uplo, sym, mt, mb, rhs, blk) { }
    LU_incpiv_(Int_ type, 
               Int_ mt, Int_ mb, 
               Int_ rhs, 
               Int_ blk)  
      : LU_piv_<A_,B_>(type, mt, mb, rhs, blk) { }
    
    LU_incpiv_(const LU_incpiv_ &b) : LU_piv_<A_,B_>(b) { }
      
    using LU_piv_<A_,B_>::get_leading_flop;

    using LU_piv_<A_,B_>::update;
    using LU_piv_<A_,B_>::decompose;
    using LU_piv_<A_,B_>::solve_1_x;
    using LU_piv_<A_,B_>::solve_2_x;
    using LU_piv_<A_,B_>::solve_1_r;
    using LU_piv_<A_,B_>::solve_2_r;
    
    virtual Int_ decompose() {
      if (this->get_mt()) 
        lu_incpiv( this->_ATL, this->_P );

      this->update();

      return true;
    }
  };
}

#endif
